package com.itheima.d1_thread_api;

/**
 * 目标：掌握sleep方法,join方法的作用。
 */
public class ThreadTest2 {
    public static void main(String[] args) throws Exception {

        for (int i = 10; i > 0; i--) {
            System.out.println(i);

            Thread.sleep(1000);
        }

        final Thread a = new Thread(() -> System.out.println("A"));
        final Thread b = new Thread(() -> System.out.println("B"));
        final Thread c = new Thread(() -> System.out.println("C"));

        a.start();
        a.join();
        b.start();
        b.join();
        c.start();
    }
}
